import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/home',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path: '/',
      name: 'Login',
      component: () => import('../views/User/Login.vue'),
    },
    {
      //主页面
      path: '/Index',
      name: 'Index',
      component: () => import('../views/Index.vue'),
      children:[

        {
          //部门管理
          path: '/Department',
          name: 'Department',
          component: () => import('../views/Department/DepartmentShow.vue'),
        },
        {
          //首页
          path: '/IndexShow',
          name: 'IndexShow',
          component: () => import('../views/IndesShow/IndesShow.vue'),
        },
        {
          //会议室管理
          path: '/MeetingManage',
          name: 'MeetingManage',
          component: () => import('../views/MeetManage/MeetingManage.vue'),
        },
        {
          //会议预约
          path: '/MeetReservation',
          name: 'MeetReservation',
          component: () => import('../views/MeetManage/MeetReservation.vue'),
        },
        {
          //会议审批
          path: '/MeetingApproval',
          name: 'MeetingApproval',
          component: () => import('../views/MeetManage/MeetingApproval.vue'),
        },
      ]
    },
  ],
})

export default router
